#include <iostream>
#include <ctime>
#include "polonet.h"
#include "tftpserver.h"

using namespace std;

int main(int argc, char *argv[])
{
    cout << "Group 1 TFTP Server - Starting connections..." << endl;

    if(startListening(CONNECTION_PORT))
    {
        cout << "Server listening on port: " << CONNECTION_PORT << endl;
        enterServerMainLoop();
        stopListening();
    }
    else
    {
        cout << "There has been an error binding the server to the port " << CONNECTION_PORT << ". Shutting down server..." << endl;
    }
    return 0;
}
